/**
 * @Description：
 * @author： YouYu 游宇
 * @createTime: 2018-12-06 4:09 AM
 **/

package com.scb.dev.mms.util;

import java.util.List;

/**
 * @className: ListUtil
 * @Description:
 * @author: YouYu 游宇
 * @createTime: 2018-12-06 4:09 AM
 **/
public class ListUtil {

    /**
     * @Description: To compare whether the given two list are equals each other.
     * @author: YouYu 游宇
     * @methodName: isListEqual
     * @param:
     * @returnType:
     * @createTime: 12/6/2018 4:10 AM
     **/
    public static boolean isListEqual(List listOne, List listTwo){
        if (listOne == listTwo)
            return true;
        if (listOne == null && listTwo == null)
            return true;
        if (listOne == null || listTwo == null)
            return false;
        if (listOne.size() != listTwo.size())
            return false;
        for (Object o : listOne) {
            if (!listTwo.contains(o))
                return false;
        }
        for (Object o : listTwo) {
            if (!listOne.contains(o))
                return false;
        }
        return true;
    }





}
